import React,{useCallback} from 'react'
import Home from './views/home/Home'
import {Route,Redirect} from 'react-router-dom'
import All from './views/home/all/pages/AllContainer'
import List from './views/home/list/List'
import Searchpage from './views/home/search/Searchpage'
import Detail from './views/home/detail/pages/Detail'
import Login from './views/home/my/Login'
import Phone from './views/home/my/Phone'
import Protect from './views/home/protect/ProtectContainer'
import  Mybuy from './views/home/my/Mybuy'
import Buyinfo from './views/home/detail/pages/Buyinfo'
import Addres from './views/home/my/Addres'
export default function App(props) {

    const home=useCallback(
        props=>{
            return <Home {...props}></Home>
        },[]
    )

    const all=useCallback(
        props=>{
            return <All {...props}></All>
        },[]
    )
    
    const search=useCallback(
        props=>{
            return <Searchpage {...props}></Searchpage>
        },[]
    )


    return (
        <div style={{height:'100%'}}>
            <Route
            path="/home"
            // children={home}
            >
                <Home></Home>
            </Route>

            <Route
            path="/all"
            // children={all}
            >
                <All></All>
            </Route>
            
            <Route
            path='/list'
            >
            <List></List>
            </Route>

            <Route
            path='/search'
            // children={search}
            >
            <Searchpage></Searchpage>
            </Route>
           
           <Route
           path='/detail'
           >
               <Detail></Detail>
           </Route>

           <Route
           path='/login'
           >
               <Login></Login>
           </Route>

            <Route
            path='/phonelogin'
            >
                <Phone></Phone>
            </Route>
            
            <Route
            path='/protect'
            > <Protect></Protect></Route>
            
            <Route
            path='/mybuy'>
                <Mybuy></Mybuy>
            </Route>
            
            <Route
            path='/order'
            >
                <Buyinfo></Buyinfo>
            </Route>
            
            <Route
            path='/addres'
            >
                <Addres></Addres>
            </Route>
            
            <Redirect from='/' to='/home'></Redirect>
            {/* <All></All> */}
        </div>
    )
}

